<template>
	<view class="article">
		<view class="article-header">
			<view class="article-header-content">
				<text>文章</text>
				<view class="article-more" @click="$goUrl('/subPackage/index/moreArticle')">
					<text>更多</text>
					<image src="@/static/arrow.png" mode="aspectFill"></image>
				</view>
			</view>
		</view>
		<view class="article-list-content">
			<view class="article-list" v-for="s,k in props.articleData"
				@click="$goUrl(`/subPackage/index/articleDetail?id=${k}`)">
				<view class="article-list-image">
					<image :src="s.image" mode="aspectFill"></image>
				</view>
				<view class="article-list-right-text-box">
					<text>{{s.title}}</text>
					<text>{{s.text}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	interface articleType {
		articleData : Array<{ image : string, title : string, text : string }>
	}

	const props = defineProps<{
		articleData : articleType['articleData']
	}>()
</script>

<style lang="scss" scoped>
	.flex {
		display: flex;
		align-items: center;
	}

	.article {
		margin-top: 40rpx
	}

	.article-header-content {
		@extend .flex;
		justify-content: space-between;

		>text {
			font-family: Source Han Sans, Source Han Sans;
			font-weight: bold;
			font-size: 32rpx;
			color: #020121;
		}

		.article-more {
			@extend .flex;

			image {
				width: 20rpx;
				height: 30rpx;
				margin-top: 1rpx;
			}

			text {
				font-family: Source Han Sans, Source Han Sans;
				font-weight: 400;
				font-size: 24rpx;
				color: #7B7B89;
			}
		}
	}


	.article-list-content {
		.article-list {
			@extend .flex;
			margin-top: 24rpx;

			.article-list-image {
				@extend .flex;

				image {
					width: 260rpx;
					height: 130rpx;
					border-radius: 20rpx;
				}
			}

			.article-list-right-text-box {
				margin-left: 16rpx;

				text {
					font-family: Source Han Sans, Source Han Sans;
					font-weight: 500;
					font-size: 28rpx;
					color: #020121;

					&:nth-last-child(1) {
						font-weight: 400;
						font-size: 24rpx;
						color: #7B7B89;
						margin-top: 16rpx;
					}
				}
			}
		}
	}
</style>